package com.itheima.String;

public class StringTest {
    public static void main(String[] args) {
        String s1 = new String();
        //string类的对象输出的不是地址值 而是对象所记录的值
        System.out.println("s1 = " + s1);

        //char类型会完成字符的拼接
        char[] chs = {'a', 'b', 'c'};
        String s2 = new String(chs);

        String s3 = new String("123");
        System.out.println("s3 = " + s3);
        //定义一个byte类型的数组
        //其值在传入String类的对象时 会自动转化成char类
        //由ASCII去转化
        byte[] bys = {97,98,99};
        String s4 = new String(bys);
        System.out.println("s4 = " + s4);

        String s5 = "abc";
        System.out.println("s5 = " + s5);
    }
}
